/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2019
 */

package net.dreamlu.db.qo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Date;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Order;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.criterion.MatchMode;
import org.springframework.data.jpa.domain.Specification;
import net.dreamlu.db.po.*;
/**
 *
 * @author lambert.wang email:lambert.wang(a)crediteyes.com
 * @version 1.0
 * @since 1.0
 */
public class OrganizationQuery extends Organization implements Serializable {
    private static final long serialVersionUID = 3148176768559230877L;
    

	/** 主键id */
	private java.lang.Integer id;	
	private java.lang.Integer notEqId;	
	/** 组织名 */
	private String likeNameWithStart;
	private String likeNameWithEnd;
	private String likeNameWithExact;
	private String likeNameWithAnywhere;
	private java.lang.String name;	
	private java.lang.String notEqName;	
	/** 地址 */
	private String likeAddressWithStart;
	private String likeAddressWithEnd;
	private String likeAddressWithExact;
	private String likeAddressWithAnywhere;
	private java.lang.String address;	
	private java.lang.String notEqAddress;	
	/** 编号 */
	private String likeCodeWithStart;
	private String likeCodeWithEnd;
	private String likeCodeWithExact;
	private String likeCodeWithAnywhere;
	private java.lang.String code;	
	private java.lang.String notEqCode;	
	/** 图标 */
	private String likeIconClsWithStart;
	private String likeIconClsWithEnd;
	private String likeIconClsWithExact;
	private String likeIconClsWithAnywhere;
	private java.lang.String iconCls;	
	private java.lang.String notEqIconCls;	
	/** 父级主键 */
	private java.lang.Integer pid;	
	private java.lang.Integer notEqPid;	
	/** 排序 */
	private Integer seq;	
	private Integer notEqSeq;	
	/** 状态[0:失效,1:正常] */
	private Integer status;	
	private Integer notEqStatus;	
	/** 创建时间 */
	private java.time.LocalDateTime createTimeBegin;
	private java.time.LocalDateTime createTimeEnd;	
	private java.time.LocalDateTime createTime;	
	private java.time.LocalDateTime notEqCreateTime;	
	/** 更新时间 */
	private java.time.LocalDateTime updateTimeBegin;
	private java.time.LocalDateTime updateTimeEnd;	
	private java.time.LocalDateTime updateTime;	
	private java.time.LocalDateTime notEqUpdateTime;	
	
	/*********** 系统属性，自动赋值 *********/
	private boolean isId;
	private boolean isNotEqId;
	private MatchMode likename;
	private boolean isName;
	private boolean isNotEqName;
	private MatchMode likeaddress;
	private boolean isAddress;
	private boolean isNotEqAddress;
	private MatchMode likecode;
	private boolean isCode;
	private boolean isNotEqCode;
	private MatchMode likeiconCls;
	private boolean isIconCls;
	private boolean isNotEqIconCls;
	private boolean isPid;
	private boolean isNotEqPid;
	private boolean isSeq;
	private boolean isNotEqSeq;
	private boolean isStatus;
	private boolean isNotEqStatus;
	private boolean isCreateTimeBegin;
	private boolean isCreateTimeEnd;
	private boolean isCreateTime;
	private boolean isNotEqCreateTime;
	private boolean isUpdateTimeBegin;
	private boolean isUpdateTimeEnd;
	private boolean isUpdateTime;
	private boolean isNotEqUpdateTime;
	private java.lang.Integer ltCriterionId;
	public void setLtId(java.lang.Integer id){
		ltCriterionId = id;
	}
	public java.lang.Integer getLtId(){
		return ltCriterionId;
	}
	private java.lang.Integer leCriterionId;
	public void setLeId(java.lang.Integer id){
		leCriterionId = id;
	}
	public java.lang.Integer getLeId(){
		return leCriterionId;
	}
	private java.lang.Integer gtCriterionId;
	public void setGtId(java.lang.Integer id){
		gtCriterionId = id;
	}
	public java.lang.Integer getGtId(){
		return gtCriterionId;
	}
	private java.lang.Integer geCriterionId;
	public void setGeId(java.lang.Integer id){
		geCriterionId = id;
	}
	public java.lang.Integer getGeId(){
		return geCriterionId;
	}
	public java.lang.Integer getId() {
		return this.id;
	}
	
	public void setId(java.lang.Integer value) {		
		this.id = value;
		this.isId = true;
	}
	public boolean hasId() {
		return this.isId;
	}
	public java.lang.Integer getNotEqId() {
		return this.notEqId;
	}
	public void setNotEqId(java.lang.Integer id) {
		this.notEqId = id;
		this.isNotEqId = true;
	}
	public boolean hasNotEqId() {
		return this.isNotEqId;
	}
	// IN or notIN
	private List<java.lang.Integer>	inCriterionId;
	private List<java.lang.Integer>	notInCriterionId;
	public void setInId(boolean isIn,List<java.lang.Integer> ids){
		if(isIn){
			inCriterionId = ids;
		}else{
			notInCriterionId = ids;
		}
	}
	public List<java.lang.Integer> getInId() {
		return inCriterionId;
	}
	public List<java.lang.Integer> getNotInId() {
		return notInCriterionId;
	}
	
	//Null or NotNull
	private Boolean nullCriterionId;
	public void setNullId(boolean isNull){
			nullCriterionId = isNull;
	}
	public Boolean getNullId(){
		return nullCriterionId;
	} 
	
	public MatchMode getLikeName() {
		return this.likename;
	}
	public String getLikeNameWithStart() {
		return this.likeNameWithStart;
	}
	public void setLikeNameWithStart(String name) {	
		setName(name);
		setLikeName(MatchMode.START);
	}
	public String getLikeNameWithEnd() {
		return this.likeNameWithEnd;
	}
	public void setLikeNameWithEnd(String name) {	
		setName(name);
		setLikeName(MatchMode.END);
	}
	public String getLikeNameWithExact() {
		return this.likeNameWithExact;
	}
	public void setLikeNameWithExact(String name) {	
		setName(name);
		setLikeName(MatchMode.EXACT);
	}
	public String getLikeNameWithAnywhere() {
		return this.likeNameWithAnywhere;
	}
	public void setLikeNameWithAnywhere(String name) {	
		setName(name);
		setLikeName(MatchMode.ANYWHERE);
	}
	private void setLikeName(MatchMode matchMode) {		
		this.likename = matchMode;
	}
	public java.lang.String getName() {
		return this.name;
	}
	
	public void setName(java.lang.String value) {		
		this.name = value;
		this.isName = true;
	}
	public boolean hasName() {
		return this.isName;
	}
	public java.lang.String getNotEqName() {
		return this.notEqName;
	}
	public void setNotEqName(java.lang.String name) {
		this.notEqName = name;
		this.isNotEqName = true;
	}
	public boolean hasNotEqName() {
		return this.isNotEqName;
	}
	// IN or notIN
	private List<java.lang.String>	inCriterionName;
	private List<java.lang.String>	notInCriterionName;
	public void setInName(boolean isIn,List<java.lang.String> names){
		if(isIn){
			inCriterionName = names;
		}else{
			notInCriterionName = names;
		}
	}
	public List<java.lang.String> getInName() {
		return inCriterionName;
	}
	public List<java.lang.String> getNotInName() {
		return notInCriterionName;
	}
	
	//Null or NotNull
	private Boolean nullCriterionName;
	public void setNullName(boolean isNull){
			nullCriterionName = isNull;
	}
	public Boolean getNullName(){
		return nullCriterionName;
	} 
	
	public MatchMode getLikeAddress() {
		return this.likeaddress;
	}
	public String getLikeAddressWithStart() {
		return this.likeAddressWithStart;
	}
	public void setLikeAddressWithStart(String address) {	
		setAddress(address);
		setLikeAddress(MatchMode.START);
	}
	public String getLikeAddressWithEnd() {
		return this.likeAddressWithEnd;
	}
	public void setLikeAddressWithEnd(String address) {	
		setAddress(address);
		setLikeAddress(MatchMode.END);
	}
	public String getLikeAddressWithExact() {
		return this.likeAddressWithExact;
	}
	public void setLikeAddressWithExact(String address) {	
		setAddress(address);
		setLikeAddress(MatchMode.EXACT);
	}
	public String getLikeAddressWithAnywhere() {
		return this.likeAddressWithAnywhere;
	}
	public void setLikeAddressWithAnywhere(String address) {	
		setAddress(address);
		setLikeAddress(MatchMode.ANYWHERE);
	}
	private void setLikeAddress(MatchMode matchMode) {		
		this.likeaddress = matchMode;
	}
	public java.lang.String getAddress() {
		return this.address;
	}
	
	public void setAddress(java.lang.String value) {		
		this.address = value;
		this.isAddress = true;
	}
	public boolean hasAddress() {
		return this.isAddress;
	}
	public java.lang.String getNotEqAddress() {
		return this.notEqAddress;
	}
	public void setNotEqAddress(java.lang.String address) {
		this.notEqAddress = address;
		this.isNotEqAddress = true;
	}
	public boolean hasNotEqAddress() {
		return this.isNotEqAddress;
	}
	// IN or notIN
	private List<java.lang.String>	inCriterionAddress;
	private List<java.lang.String>	notInCriterionAddress;
	public void setInAddress(boolean isIn,List<java.lang.String> addresss){
		if(isIn){
			inCriterionAddress = addresss;
		}else{
			notInCriterionAddress = addresss;
		}
	}
	public List<java.lang.String> getInAddress() {
		return inCriterionAddress;
	}
	public List<java.lang.String> getNotInAddress() {
		return notInCriterionAddress;
	}
	
	//Null or NotNull
	private Boolean nullCriterionAddress;
	public void setNullAddress(boolean isNull){
			nullCriterionAddress = isNull;
	}
	public Boolean getNullAddress(){
		return nullCriterionAddress;
	} 
	
	public MatchMode getLikeCode() {
		return this.likecode;
	}
	public String getLikeCodeWithStart() {
		return this.likeCodeWithStart;
	}
	public void setLikeCodeWithStart(String code) {	
		setCode(code);
		setLikeCode(MatchMode.START);
	}
	public String getLikeCodeWithEnd() {
		return this.likeCodeWithEnd;
	}
	public void setLikeCodeWithEnd(String code) {	
		setCode(code);
		setLikeCode(MatchMode.END);
	}
	public String getLikeCodeWithExact() {
		return this.likeCodeWithExact;
	}
	public void setLikeCodeWithExact(String code) {	
		setCode(code);
		setLikeCode(MatchMode.EXACT);
	}
	public String getLikeCodeWithAnywhere() {
		return this.likeCodeWithAnywhere;
	}
	public void setLikeCodeWithAnywhere(String code) {	
		setCode(code);
		setLikeCode(MatchMode.ANYWHERE);
	}
	private void setLikeCode(MatchMode matchMode) {		
		this.likecode = matchMode;
	}
	public java.lang.String getCode() {
		return this.code;
	}
	
	public void setCode(java.lang.String value) {		
		this.code = value;
		this.isCode = true;
	}
	public boolean hasCode() {
		return this.isCode;
	}
	public java.lang.String getNotEqCode() {
		return this.notEqCode;
	}
	public void setNotEqCode(java.lang.String code) {
		this.notEqCode = code;
		this.isNotEqCode = true;
	}
	public boolean hasNotEqCode() {
		return this.isNotEqCode;
	}
	// IN or notIN
	private List<java.lang.String>	inCriterionCode;
	private List<java.lang.String>	notInCriterionCode;
	public void setInCode(boolean isIn,List<java.lang.String> codes){
		if(isIn){
			inCriterionCode = codes;
		}else{
			notInCriterionCode = codes;
		}
	}
	public List<java.lang.String> getInCode() {
		return inCriterionCode;
	}
	public List<java.lang.String> getNotInCode() {
		return notInCriterionCode;
	}
	
	//Null or NotNull
	private Boolean nullCriterionCode;
	public void setNullCode(boolean isNull){
			nullCriterionCode = isNull;
	}
	public Boolean getNullCode(){
		return nullCriterionCode;
	} 
	
	public MatchMode getLikeIconCls() {
		return this.likeiconCls;
	}
	public String getLikeIconClsWithStart() {
		return this.likeIconClsWithStart;
	}
	public void setLikeIconClsWithStart(String iconCls) {	
		setIconCls(iconCls);
		setLikeIconCls(MatchMode.START);
	}
	public String getLikeIconClsWithEnd() {
		return this.likeIconClsWithEnd;
	}
	public void setLikeIconClsWithEnd(String iconCls) {	
		setIconCls(iconCls);
		setLikeIconCls(MatchMode.END);
	}
	public String getLikeIconClsWithExact() {
		return this.likeIconClsWithExact;
	}
	public void setLikeIconClsWithExact(String iconCls) {	
		setIconCls(iconCls);
		setLikeIconCls(MatchMode.EXACT);
	}
	public String getLikeIconClsWithAnywhere() {
		return this.likeIconClsWithAnywhere;
	}
	public void setLikeIconClsWithAnywhere(String iconCls) {	
		setIconCls(iconCls);
		setLikeIconCls(MatchMode.ANYWHERE);
	}
	private void setLikeIconCls(MatchMode matchMode) {		
		this.likeiconCls = matchMode;
	}
	public java.lang.String getIconCls() {
		return this.iconCls;
	}
	
	public void setIconCls(java.lang.String value) {		
		this.iconCls = value;
		this.isIconCls = true;
	}
	public boolean hasIconCls() {
		return this.isIconCls;
	}
	public java.lang.String getNotEqIconCls() {
		return this.notEqIconCls;
	}
	public void setNotEqIconCls(java.lang.String iconCls) {
		this.notEqIconCls = iconCls;
		this.isNotEqIconCls = true;
	}
	public boolean hasNotEqIconCls() {
		return this.isNotEqIconCls;
	}
	// IN or notIN
	private List<java.lang.String>	inCriterionIconCls;
	private List<java.lang.String>	notInCriterionIconCls;
	public void setInIconCls(boolean isIn,List<java.lang.String> iconClss){
		if(isIn){
			inCriterionIconCls = iconClss;
		}else{
			notInCriterionIconCls = iconClss;
		}
	}
	public List<java.lang.String> getInIconCls() {
		return inCriterionIconCls;
	}
	public List<java.lang.String> getNotInIconCls() {
		return notInCriterionIconCls;
	}
	
	//Null or NotNull
	private Boolean nullCriterionIconCls;
	public void setNullIconCls(boolean isNull){
			nullCriterionIconCls = isNull;
	}
	public Boolean getNullIconCls(){
		return nullCriterionIconCls;
	} 
	
	private java.lang.Integer ltCriterionPid;
	public void setLtPid(java.lang.Integer pid){
		ltCriterionPid = pid;
	}
	public java.lang.Integer getLtPid(){
		return ltCriterionPid;
	}
	private java.lang.Integer leCriterionPid;
	public void setLePid(java.lang.Integer pid){
		leCriterionPid = pid;
	}
	public java.lang.Integer getLePid(){
		return leCriterionPid;
	}
	private java.lang.Integer gtCriterionPid;
	public void setGtPid(java.lang.Integer pid){
		gtCriterionPid = pid;
	}
	public java.lang.Integer getGtPid(){
		return gtCriterionPid;
	}
	private java.lang.Integer geCriterionPid;
	public void setGePid(java.lang.Integer pid){
		geCriterionPid = pid;
	}
	public java.lang.Integer getGePid(){
		return geCriterionPid;
	}
	public java.lang.Integer getPid() {
		return this.pid;
	}
	
	public void setPid(java.lang.Integer value) {		
		this.pid = value;
		this.isPid = true;
	}
	public boolean hasPid() {
		return this.isPid;
	}
	public java.lang.Integer getNotEqPid() {
		return this.notEqPid;
	}
	public void setNotEqPid(java.lang.Integer pid) {
		this.notEqPid = pid;
		this.isNotEqPid = true;
	}
	public boolean hasNotEqPid() {
		return this.isNotEqPid;
	}
	// IN or notIN
	private List<java.lang.Integer>	inCriterionPid;
	private List<java.lang.Integer>	notInCriterionPid;
	public void setInPid(boolean isIn,List<java.lang.Integer> pids){
		if(isIn){
			inCriterionPid = pids;
		}else{
			notInCriterionPid = pids;
		}
	}
	public List<java.lang.Integer> getInPid() {
		return inCriterionPid;
	}
	public List<java.lang.Integer> getNotInPid() {
		return notInCriterionPid;
	}
	
	//Null or NotNull
	private Boolean nullCriterionPid;
	public void setNullPid(boolean isNull){
			nullCriterionPid = isNull;
	}
	public Boolean getNullPid(){
		return nullCriterionPid;
	} 
	
	public Integer getSeq() {
		return this.seq;
	}
	
	public void setSeq(Integer value) {		
		this.seq = value;
		this.isSeq = true;
	}
	public boolean hasSeq() {
		return this.isSeq;
	}
	public Integer getNotEqSeq() {
		return this.notEqSeq;
	}
	public void setNotEqSeq(Integer seq) {
		this.notEqSeq = seq;
		this.isNotEqSeq = true;
	}
	public boolean hasNotEqSeq() {
		return this.isNotEqSeq;
	}
	// IN or notIN
	private List<Integer>	inCriterionSeq;
	private List<Integer>	notInCriterionSeq;
	public void setInSeq(boolean isIn,List<Integer> seqs){
		if(isIn){
			inCriterionSeq = seqs;
		}else{
			notInCriterionSeq = seqs;
		}
	}
	public List<Integer> getInSeq() {
		return inCriterionSeq;
	}
	public List<Integer> getNotInSeq() {
		return notInCriterionSeq;
	}
	
	//Null or NotNull
	private Boolean nullCriterionSeq;
	public void setNullSeq(boolean isNull){
			nullCriterionSeq = isNull;
	}
	public Boolean getNullSeq(){
		return nullCriterionSeq;
	} 
	
	public Integer getStatus() {
		return this.status;
	}
	
	public void setStatus(Integer value) {		
		this.status = value;
		this.isStatus = true;
	}
	public boolean hasStatus() {
		return this.isStatus;
	}
	public Integer getNotEqStatus() {
		return this.notEqStatus;
	}
	public void setNotEqStatus(Integer status) {
		this.notEqStatus = status;
		this.isNotEqStatus = true;
	}
	public boolean hasNotEqStatus() {
		return this.isNotEqStatus;
	}
	// IN or notIN
	private List<Integer>	inCriterionStatus;
	private List<Integer>	notInCriterionStatus;
	public void setInStatus(boolean isIn,List<Integer> statuss){
		if(isIn){
			inCriterionStatus = statuss;
		}else{
			notInCriterionStatus = statuss;
		}
	}
	public List<Integer> getInStatus() {
		return inCriterionStatus;
	}
	public List<Integer> getNotInStatus() {
		return notInCriterionStatus;
	}
	
	//Null or NotNull
	private Boolean nullCriterionStatus;
	public void setNullStatus(boolean isNull){
			nullCriterionStatus = isNull;
	}
	public Boolean getNullStatus(){
		return nullCriterionStatus;
	} 
	
	public java.time.LocalDateTime getCreateTimeBegin() {
		return this.createTimeBegin;
	}
	
	public void setCreateTimeBegin(java.time.LocalDateTime value) {
		this.createTimeBegin = value;
		this.isCreateTimeBegin = true;
	}	
	
	public java.time.LocalDateTime getCreateTimeEnd() {
		return this.createTimeEnd;
	}
	
	public void setCreateTimeEnd(java.time.LocalDateTime value) {
		this.createTimeEnd = value;
		this.isCreateTimeEnd = true;
	}
	public boolean hasCreateTimeBegin() {
		return this.isCreateTimeBegin;
	}
	public boolean hasCreateTimeEnd() {
		return this.isCreateTimeEnd;
	}	
	public java.time.LocalDateTime getCreateTime() {
		return this.createTime;
	}
	
	public void setCreateTime(java.time.LocalDateTime value) {		
		this.createTime = value;
		this.isCreateTime = true;
	}
	public boolean hasCreateTime() {
		return this.isCreateTime;
	}
	public java.time.LocalDateTime getNotEqCreateTime() {
		return this.notEqCreateTime;
	}
	public void setNotEqCreateTime(java.time.LocalDateTime createTime) {
		this.notEqCreateTime = createTime;
		this.isNotEqCreateTime = true;
	}
	public boolean hasNotEqCreateTime() {
		return this.isNotEqCreateTime;
	}
	// IN or notIN
	private List<java.time.LocalDateTime>	inCriterionCreateTime;
	private List<java.time.LocalDateTime>	notInCriterionCreateTime;
	public void setInCreateTime(boolean isIn,List<java.time.LocalDateTime> createTimes){
		if(isIn){
			inCriterionCreateTime = createTimes;
		}else{
			notInCriterionCreateTime = createTimes;
		}
	}
	public List<java.time.LocalDateTime> getInCreateTime() {
		return inCriterionCreateTime;
	}
	public List<java.time.LocalDateTime> getNotInCreateTime() {
		return notInCriterionCreateTime;
	}
	
	//Null or NotNull
	private Boolean nullCriterionCreateTime;
	public void setNullCreateTime(boolean isNull){
			nullCriterionCreateTime = isNull;
	}
	public Boolean getNullCreateTime(){
		return nullCriterionCreateTime;
	} 
	
	public java.time.LocalDateTime getUpdateTimeBegin() {
		return this.updateTimeBegin;
	}
	
	public void setUpdateTimeBegin(java.time.LocalDateTime value) {
		this.updateTimeBegin = value;
		this.isUpdateTimeBegin = true;
	}	
	
	public java.time.LocalDateTime getUpdateTimeEnd() {
		return this.updateTimeEnd;
	}
	
	public void setUpdateTimeEnd(java.time.LocalDateTime value) {
		this.updateTimeEnd = value;
		this.isUpdateTimeEnd = true;
	}
	public boolean hasUpdateTimeBegin() {
		return this.isUpdateTimeBegin;
	}
	public boolean hasUpdateTimeEnd() {
		return this.isUpdateTimeEnd;
	}	
	public java.time.LocalDateTime getUpdateTime() {
		return this.updateTime;
	}
	
	public void setUpdateTime(java.time.LocalDateTime value) {		
		this.updateTime = value;
		this.isUpdateTime = true;
	}
	public boolean hasUpdateTime() {
		return this.isUpdateTime;
	}
	public java.time.LocalDateTime getNotEqUpdateTime() {
		return this.notEqUpdateTime;
	}
	public void setNotEqUpdateTime(java.time.LocalDateTime updateTime) {
		this.notEqUpdateTime = updateTime;
		this.isNotEqUpdateTime = true;
	}
	public boolean hasNotEqUpdateTime() {
		return this.isNotEqUpdateTime;
	}
	// IN or notIN
	private List<java.time.LocalDateTime>	inCriterionUpdateTime;
	private List<java.time.LocalDateTime>	notInCriterionUpdateTime;
	public void setInUpdateTime(boolean isIn,List<java.time.LocalDateTime> updateTimes){
		if(isIn){
			inCriterionUpdateTime = updateTimes;
		}else{
			notInCriterionUpdateTime = updateTimes;
		}
	}
	public List<java.time.LocalDateTime> getInUpdateTime() {
		return inCriterionUpdateTime;
	}
	public List<java.time.LocalDateTime> getNotInUpdateTime() {
		return notInCriterionUpdateTime;
	}
	
	//Null or NotNull
	private Boolean nullCriterionUpdateTime;
	public void setNullUpdateTime(boolean isNull){
			nullCriterionUpdateTime = isNull;
	}
	public Boolean getNullUpdateTime(){
		return nullCriterionUpdateTime;
	} 
	
	private List<String> listOrderAsc = new ArrayList<>();
	private List<String> listOrderDesc = new ArrayList<>();

	public void setOrderAsc(String fdName) {
		listOrderAsc.add(fdName);
	}

	public void setOrderDec(String fdName) {
		listOrderDesc.add(fdName);
	}

	public List<String> getOrderAscList() {
		return listOrderAsc;
	}

	public List<String> getOrderDecList() {
		return listOrderDesc;
	}
	
	
	/**
	 * 获取查询条件
	 */
	public Specification<Organization> createSpecification() {
		Specification<Organization> example = (root, query, criteriaBuilder) -> {
			List<Order> orders = new ArrayList<>();
			for (String asc : this.getOrderAscList()) {
				orders.add(criteriaBuilder.asc(root.get(asc)));
			}
			for (String desc : this.getOrderDecList()) {
				orders.add(criteriaBuilder.desc(root.get(desc)));
			}
			query.orderBy(orders);
			List<Predicate> predicates = createQuery(root, this, criteriaBuilder);
			hookQuery(root, criteriaBuilder,predicates);
			return query.where(predicates.toArray(new Predicate[predicates.size()])).getRestriction();
		};
		return example;
	}
	/**
	 * <p>
	 * <p>自定义的方法时候实现此方法即可(内部类方式使用即可)
	 * <p>使用方法: predicates.add(criteriaBuilder.equal(root.get("biaoqian").as(String.class), "value"));
	 * @param root
	 * @param query
	 * @param criteriaBuilder
	 * @param predicates
	 */
	public void hookQuery(Root<Organization> root, CriteriaBuilder criteriaBuilder,List<Predicate> predicates) {}
	/**
	 * 组装query对象
	 * 
	 * @param root
	 * @param OrganizationQuery
	 * @param criteriaBuilder
	 * @return
	 */
	private List<Predicate> createQuery(Root<Organization> root, OrganizationQuery query, CriteriaBuilder criteriaBuilder) {
		List<Predicate> predicates = new ArrayList<Predicate>();
		/**
		 * idExpression
		 */
		Expression<java.lang.Integer> idExpression = root.get(Organization.PROP_ID).as(java.lang.Integer.class);
		if (query.hasId()) {
			java.lang.Integer value = query.getId();
			if( value != null){
				predicates.add(criteriaBuilder.equal(idExpression, value));					
			}
		}
		if (query.hasNotEqId()) {
			java.lang.Integer value = query.getNotEqId();
			predicates.add(criteriaBuilder.notEqual(idExpression, value));
		}
		
		if(query.getLeId()!=null){
			predicates.add(criteriaBuilder.le(idExpression, query.getLeId()));
		}
		if(query.getGeId()!=null){
			predicates.add(criteriaBuilder.ge(idExpression, query.getGeId()));
		}
		if(query.getLtId()!=null){
			predicates.add(criteriaBuilder.lt(idExpression, query.getLtId()));
		}
		if(query.getGtId()!=null){
			predicates.add(criteriaBuilder.gt(idExpression, query.getGtId()));
		}
		
		if (query.getInId() != null) {
			predicates.add(idExpression.in(query.getInId()));
		}
		if (query.getNotInId() != null) {
			predicates.add(criteriaBuilder.not(idExpression.in(query.getInId())));
		}
		if (query.getNullId() != null) {
			if (query.getNullId()) {
				predicates.add(criteriaBuilder.isNull(idExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(idExpression));
			}
		}
		/**
		 * nameExpression
		 */
		Expression<java.lang.String> nameExpression = root.get(Organization.PROP_NAME).as(java.lang.String.class);
		if (query.hasName()) {
			java.lang.String value = query.getName();
			if (query.getLikeName() != null) {
				predicates.add(criteriaBuilder.like(nameExpression, query.getLikeName().toMatchString(value)));
			} else {
				predicates.add(criteriaBuilder.equal(nameExpression, value));
			}
		}
		if (query.hasNotEqName()) {
			java.lang.String value = query.getNotEqName();
			predicates.add(criteriaBuilder.notEqual(nameExpression, value));
		}
		
		if (query.getInName() != null) {
			predicates.add(nameExpression.in(query.getInName()));
		}
		if (query.getNotInName() != null) {
			predicates.add(criteriaBuilder.not(nameExpression.in(query.getInName())));
		}
		if (query.getNullName() != null) {
			if (query.getNullName()) {
				predicates.add(criteriaBuilder.isNull(nameExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(nameExpression));
			}
		}
		/**
		 * addressExpression
		 */
		Expression<java.lang.String> addressExpression = root.get(Organization.PROP_ADDRESS).as(java.lang.String.class);
		if (query.hasAddress()) {
			java.lang.String value = query.getAddress();
			if (query.getLikeAddress() != null) {
				predicates.add(criteriaBuilder.like(addressExpression, query.getLikeAddress().toMatchString(value)));
			} else {
				predicates.add(criteriaBuilder.equal(addressExpression, value));
			}
		}
		if (query.hasNotEqAddress()) {
			java.lang.String value = query.getNotEqAddress();
			predicates.add(criteriaBuilder.notEqual(addressExpression, value));
		}
		
		if (query.getInAddress() != null) {
			predicates.add(addressExpression.in(query.getInAddress()));
		}
		if (query.getNotInAddress() != null) {
			predicates.add(criteriaBuilder.not(addressExpression.in(query.getInAddress())));
		}
		if (query.getNullAddress() != null) {
			if (query.getNullAddress()) {
				predicates.add(criteriaBuilder.isNull(addressExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(addressExpression));
			}
		}
		/**
		 * codeExpression
		 */
		Expression<java.lang.String> codeExpression = root.get(Organization.PROP_CODE).as(java.lang.String.class);
		if (query.hasCode()) {
			java.lang.String value = query.getCode();
			if (query.getLikeCode() != null) {
				predicates.add(criteriaBuilder.like(codeExpression, query.getLikeCode().toMatchString(value)));
			} else {
				predicates.add(criteriaBuilder.equal(codeExpression, value));
			}
		}
		if (query.hasNotEqCode()) {
			java.lang.String value = query.getNotEqCode();
			predicates.add(criteriaBuilder.notEqual(codeExpression, value));
		}
		
		if (query.getInCode() != null) {
			predicates.add(codeExpression.in(query.getInCode()));
		}
		if (query.getNotInCode() != null) {
			predicates.add(criteriaBuilder.not(codeExpression.in(query.getInCode())));
		}
		if (query.getNullCode() != null) {
			if (query.getNullCode()) {
				predicates.add(criteriaBuilder.isNull(codeExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(codeExpression));
			}
		}
		/**
		 * iconClsExpression
		 */
		Expression<java.lang.String> iconClsExpression = root.get(Organization.PROP_ICON_CLS).as(java.lang.String.class);
		if (query.hasIconCls()) {
			java.lang.String value = query.getIconCls();
			if (query.getLikeIconCls() != null) {
				predicates.add(criteriaBuilder.like(iconClsExpression, query.getLikeIconCls().toMatchString(value)));
			} else {
				predicates.add(criteriaBuilder.equal(iconClsExpression, value));
			}
		}
		if (query.hasNotEqIconCls()) {
			java.lang.String value = query.getNotEqIconCls();
			predicates.add(criteriaBuilder.notEqual(iconClsExpression, value));
		}
		
		if (query.getInIconCls() != null) {
			predicates.add(iconClsExpression.in(query.getInIconCls()));
		}
		if (query.getNotInIconCls() != null) {
			predicates.add(criteriaBuilder.not(iconClsExpression.in(query.getInIconCls())));
		}
		if (query.getNullIconCls() != null) {
			if (query.getNullIconCls()) {
				predicates.add(criteriaBuilder.isNull(iconClsExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(iconClsExpression));
			}
		}
		/**
		 * pidExpression
		 */
		Expression<java.lang.Integer> pidExpression = root.get(Organization.PROP_PID).as(java.lang.Integer.class);
		if (query.hasPid()) {
			java.lang.Integer value = query.getPid();
			if( value != null){
				predicates.add(criteriaBuilder.equal(pidExpression, value));					
			}
		}
		if (query.hasNotEqPid()) {
			java.lang.Integer value = query.getNotEqPid();
			predicates.add(criteriaBuilder.notEqual(pidExpression, value));
		}
		
		if(query.getLePid()!=null){
			predicates.add(criteriaBuilder.le(pidExpression, query.getLePid()));
		}
		if(query.getGePid()!=null){
			predicates.add(criteriaBuilder.ge(pidExpression, query.getGePid()));
		}
		if(query.getLtPid()!=null){
			predicates.add(criteriaBuilder.lt(pidExpression, query.getLtPid()));
		}
		if(query.getGtPid()!=null){
			predicates.add(criteriaBuilder.gt(pidExpression, query.getGtPid()));
		}
		
		if (query.getInPid() != null) {
			predicates.add(pidExpression.in(query.getInPid()));
		}
		if (query.getNotInPid() != null) {
			predicates.add(criteriaBuilder.not(pidExpression.in(query.getInPid())));
		}
		if (query.getNullPid() != null) {
			if (query.getNullPid()) {
				predicates.add(criteriaBuilder.isNull(pidExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(pidExpression));
			}
		}
		/**
		 * seqExpression
		 */
		Expression<Integer> seqExpression = root.get(Organization.PROP_SEQ).as(Integer.class);
		if (query.hasSeq()) {
			Integer value = query.getSeq();
			if( value != null){
				predicates.add(criteriaBuilder.equal(seqExpression, value));					
			}
		}
		if (query.hasNotEqSeq()) {
			Integer value = query.getNotEqSeq();
			predicates.add(criteriaBuilder.notEqual(seqExpression, value));
		}
		
		if (query.getInSeq() != null) {
			predicates.add(seqExpression.in(query.getInSeq()));
		}
		if (query.getNotInSeq() != null) {
			predicates.add(criteriaBuilder.not(seqExpression.in(query.getInSeq())));
		}
		if (query.getNullSeq() != null) {
			if (query.getNullSeq()) {
				predicates.add(criteriaBuilder.isNull(seqExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(seqExpression));
			}
		}
		/**
		 * statusExpression
		 */
		Expression<Integer> statusExpression = root.get(Organization.PROP_STATUS).as(Integer.class);
		if (query.hasStatus()) {
			Integer value = query.getStatus();
			if( value != null){
				predicates.add(criteriaBuilder.equal(statusExpression, value));					
			}
		}
		if (query.hasNotEqStatus()) {
			Integer value = query.getNotEqStatus();
			predicates.add(criteriaBuilder.notEqual(statusExpression, value));
		}
		
		if (query.getInStatus() != null) {
			predicates.add(statusExpression.in(query.getInStatus()));
		}
		if (query.getNotInStatus() != null) {
			predicates.add(criteriaBuilder.not(statusExpression.in(query.getInStatus())));
		}
		if (query.getNullStatus() != null) {
			if (query.getNullStatus()) {
				predicates.add(criteriaBuilder.isNull(statusExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(statusExpression));
			}
		}
		/**
		 * createTimeExpression
		 */
		Expression<java.time.LocalDateTime> createTimeExpression = root.get(Organization.PROP_CREATE_TIME).as(java.time.LocalDateTime.class);
		if(query.hasCreateTimeBegin() && query.getCreateTimeBegin()!= null){
			if(!query.hasCreateTimeEnd() || query.getCreateTimeEnd() == null){
				predicates.add(criteriaBuilder.greaterThan(createTimeExpression, query.getCreateTimeBegin()));
			}else{
				predicates.add(criteriaBuilder.between(createTimeExpression, query.getCreateTimeBegin(), query.getCreateTimeEnd()));
			}			
		}
		if(query.hasCreateTimeEnd() && query.getCreateTimeEnd()!=null){
			if(!query.hasCreateTimeBegin() || query.getCreateTimeBegin() == null){
				predicates.add(criteriaBuilder.lessThan(createTimeExpression, query.getCreateTimeBegin()));
			}
		}							
		if (query.hasCreateTime()) {
			java.time.LocalDateTime value = query.getCreateTime();
			if( value != null){
				predicates.add(criteriaBuilder.equal(createTimeExpression, value));					
			}
		}
		if (query.hasNotEqCreateTime()) {
			java.time.LocalDateTime value = query.getNotEqCreateTime();
			predicates.add(criteriaBuilder.notEqual(createTimeExpression, value));
		}
		
		if (query.getInCreateTime() != null) {
			predicates.add(createTimeExpression.in(query.getInCreateTime()));
		}
		if (query.getNotInCreateTime() != null) {
			predicates.add(criteriaBuilder.not(createTimeExpression.in(query.getInCreateTime())));
		}
		if (query.getNullCreateTime() != null) {
			if (query.getNullCreateTime()) {
				predicates.add(criteriaBuilder.isNull(createTimeExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(createTimeExpression));
			}
		}
		/**
		 * updateTimeExpression
		 */
		Expression<java.time.LocalDateTime> updateTimeExpression = root.get(Organization.PROP_UPDATE_TIME).as(java.time.LocalDateTime.class);
		if(query.hasUpdateTimeBegin() && query.getUpdateTimeBegin()!= null){
			if(!query.hasUpdateTimeEnd() || query.getUpdateTimeEnd() == null){
				predicates.add(criteriaBuilder.greaterThan(updateTimeExpression, query.getUpdateTimeBegin()));
			}else{
				predicates.add(criteriaBuilder.between(updateTimeExpression, query.getUpdateTimeBegin(), query.getUpdateTimeEnd()));
			}			
		}
		if(query.hasUpdateTimeEnd() && query.getUpdateTimeEnd()!=null){
			if(!query.hasUpdateTimeBegin() || query.getUpdateTimeBegin() == null){
				predicates.add(criteriaBuilder.lessThan(updateTimeExpression, query.getUpdateTimeBegin()));
			}
		}							
		if (query.hasUpdateTime()) {
			java.time.LocalDateTime value = query.getUpdateTime();
			if( value != null){
				predicates.add(criteriaBuilder.equal(updateTimeExpression, value));					
			}
		}
		if (query.hasNotEqUpdateTime()) {
			java.time.LocalDateTime value = query.getNotEqUpdateTime();
			predicates.add(criteriaBuilder.notEqual(updateTimeExpression, value));
		}
		
		if (query.getInUpdateTime() != null) {
			predicates.add(updateTimeExpression.in(query.getInUpdateTime()));
		}
		if (query.getNotInUpdateTime() != null) {
			predicates.add(criteriaBuilder.not(updateTimeExpression.in(query.getInUpdateTime())));
		}
		if (query.getNullUpdateTime() != null) {
			if (query.getNullUpdateTime()) {
				predicates.add(criteriaBuilder.isNull(updateTimeExpression));
			} else {
				predicates.add(criteriaBuilder.isNotNull(updateTimeExpression));
			}
		}
		return predicates;
	}
	public String toString() {
		return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE);
	}
	
}

